package com.example.my_music_palyer.service;

import com.example.my_music_palyer.mapper.ImageMapper;
import com.example.my_music_palyer.model.User;
import org.apache.ibatis.annotations.Param;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

@Service
public class ImageService {
    @Autowired
    ImageMapper imageMapper;

    public int uploadImage(String url, User user) {
        return imageMapper.uploadImage(user.getId(), user.getUsername(), url, 1);
    }

    public int updateImage(User user, int flag,String url) {

        return imageMapper.updateImage(user.getId(), flag,url);
    }

    public String getUseImageUrl(User user){
        return imageMapper.getUseImageUrl(user.getId());
    }


}
